<template>
    <el-row class="lives-news">
        <el-row class="title">
            <h3>在线会员</h3>
        </el-row>
        <el-row>
            真实会员人数: {{counts}}
        </el-row>
        <el-row>
            <el-table :data="datas" border>
                <el-table-column prop="userId" label="userId" align="center"></el-table-column>
                <el-table-column prop="name" label="昵称" align="center"></el-table-column>
                <el-table-column prop="level" label="等级" align="center"></el-table-column>
                <el-table-column label="是否内部号" align="center">
                	<template slot-scope="scope">
                		{{scope.row.salesman?'是':'否'}}
                	</template>
                </el-table-column>
            </el-table>
        </el-row>
    </el-row>
</template>
<script>
import {
    getOnlineRealList
} from '@/api/api'
export default {
    data: function() {
        return {
            datas: [],
            counts: 0
        }
    },
    created: function(){
        this.getOnlineUser();
    },
    methods:{
        getOnlineUser: function(){
            getOnlineRealList().then(res => {
                this.counts = res.length;
                this.datas = res
            })
        },
        currentChange: function(val) {
            this.$router.push('?page=' + val)
            this.pageId = val;
            this.getOnlineUser()
        }
    }
}
</script>
<style scoped lang="scss">
    .lives-news {
        .title {
            font-size: 12px;
            border-bottom: 1px solid #eaeaea;
            margin-bottom: 5px;
            h3 {
                display: inline-block;
                padding: 5px 0;
                margin: 0;
                font-weight: normal;
                color: #23b7e5;
                border-bottom: 1px solid #23b7e5;
            }
        }
        .banner-thumb{
            width: 100%;
        }
        .thumb{
            width: 120px;
        }
    }
</style>